<?php
/**
 * 体检套餐
 *
 * User: kaikaic
 * Date: 2018/10/24
 * Time: 23:03
 */

namespace app\exam\service;

use service\BasicService;
use think\Db;

class MecSetService extends BasicService {

    public function init() {
        $this->dataTable = ['ExamSet'];
    }

    public function listAll($tableIndex=0) {
        return Db::name($this->dataTable[$tableIndex])->select();
    }

    public function getSet($setID) {
        $where = array();
        $where['id'] = $setID;

        return $this->single($where);
    }

    /**
     * 当前排序最大值,新纪录自动+1
     */
    public function getMaxSort($tableIndex=0) {
        return Db::name($this->dataTable[$tableIndex])->max('sort');
    }
}

